﻿using PetaPoco;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BrnMall.Manager.Domain.User
{
    /// <summary>
    /// 当面付
    /// </summary>
    [TableName("bma_directpayment")]
    [PrimaryKey("pid")]
    public class DirectPayment
    {
        /// <summary>
        /// 主键
        /// </summary>
        public int Pid { get; set; }
        /// <summary>
        /// 订单号
        /// </summary>
        public string PSN { get; set; }
        /// <summary>
        /// 用户ID
        /// </summary>
        public int Uid { get; set; }
        /// <summary>
        /// 支付状态0:待支付，1：已支付，2：已取消
        /// </summary>
        public int OrderState { get; set; }
        /// <summary>
        /// 订单金额
        /// </summary>
        public decimal OrderAmount { get; set; }
        /// <summary>
        /// 剩余支付金额
        /// </summary>
        public decimal SurplusMoney { get; set; }
        /// <summary>
        /// 添加时间
        /// </summary>
        public DateTime AddTime { get; set; }
        /// <summary>
        ///店铺ID
        /// </summary>
        public int StoreId { get; set; }
        /// <summary>
        /// 支付流水号
        /// </summary>
        public string PaySN { get; set; }
        /// <summary>
        /// 支付时间
        /// </summary>
        public DateTime PayTime { get; set; }
        /// <summary>
        /// 支付系统名称
        /// </summary>
        public string PaySystemName { get; set; }
        
        /// <summary>
        /// 消耗积分数量
        /// </summary>
        public int PayCreditCount { get; set; }
        /// <summary>
        /// 积分换算后的金额
        /// </summary>
        public decimal PayCreditMoney { get; set; }
        /// <summary>
        /// 优惠券金额
        /// </summary>
        public decimal CouponMoney { get; set; }
        /// <summary>
        /// 优惠券列表
        /// </summary>
        public string CouponIds { get; set; }

        /// <summary>
        /// 余额支付的金额
        /// </summary>
        public decimal PayCash { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public DirectPayment() {
            PSN = string.Empty;
            Uid = 0;
            OrderState = 0;
            OrderAmount = SurplusMoney = PayCreditMoney = CouponMoney = PayCash = 0;
            AddTime = PayTime = new DateTime(1900, 1, 1);
            StoreId = 0;
            PaySN =PaySystemName = CouponIds=string.Empty;
            PayCreditCount = 0;

        }
    }
}
